/********************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2009.
-------------------------------------------------------------------------
File name:   DebugDrawContext.h
$Id$
Description: Render context (set of flags)

-------------------------------------------------------------------------
History:
- 2009-2-17   : Created by Evgeny Adamenkov

*********************************************************************/

#ifndef _DEBUG_DRAW_CONTEXT_H_
#define _DEBUG_DRAW_CONTEXT_H_

#if _MSC_VER > 1000
#pragma once
#endif

#include "Environment.h"
#include "IAIDebugRenderer.h"


class CDebugDrawContext
{
	const size_t m_uiDepth;
	
public:
	CDebugDrawContext() : m_uiDepth(gAIEnv.pAIDebugRenderer->PushState()) {}

	~CDebugDrawContext()
	{
		size_t uiDepth = gAIEnv.pAIDebugRenderer->PopState();
		assert(uiDepth + 1 == m_uiDepth);
	}

	IAIDebugRenderer* operator->() const { return gAIEnv.pAIDebugRenderer; }
};


#endif	// #ifndef _DEBUG_DRAW_CONTEXT_H_
